import React from "react";
import { Link, useRoutes } from "react-router-dom";

import routes from "./router";

const App = () => {
  const element = useRoutes(routes);

  return (
    <>
      <h2>router-v6-路由懒加载</h2>
      <ul>
        <li>
          <Link to="/home">home</Link>
        </li>
        <li>
          <Link to="/about">about</Link>
        </li>
      </ul>

      <hr />

      {element}
    </>
  );
};

export default App;
